﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using XiuxianGame.人物;
using XiuxianGame.地图资源;
using XiuxianGame.运行时资源.事件方法;

namespace XiuxianGame.图形资源库.GroupBox
{
    public partial class 当前地点信息 : UserControl
    {

        public 当前地点信息()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void 人物属性_Load(object sender, EventArgs e)
        {
            
        }
        public void loadThisNPC()
        {
            Dictionary<string, Player> dic = MainPage.Player.getNPC();
            foreach(KeyValuePair<string, Player> player in dic)
            {
                Player p = player.Value;
                this.dataGridView1.Rows.Add(p.Name,p.Sex, KeyToVal.JingJie(p.Djingjie, p.Djingjie));
            }
            
        }

        private void dataGridView1_MouseDown(object sender, MouseEventArgs e)
        {

        }

        private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right && e.RowIndex > -1 && e.ColumnIndex > -1) { 
                if ((sender as DataGridView).SelectedRows.Count == 1)
                {
                    (sender as DataGridView).ClearSelection();
                }
                (sender as DataGridView).Rows[e.RowIndex].Selected = true;
                
                this.contextMenuStrip_社会.Show(Cursor.Position);
            }
        }
    }
}
